package cn.linjianhui.interview.patterns.singleton;

// 懒汉模式，获取实例时创建，存在并发问题
public class LazySingleton {
    private static LazySingleton instance;
    private LazySingleton() {

    }

    public static synchronized LazySingleton getInstance() {
        if(instance == null) {
            instance = new LazySingleton();
        }
        return instance;
    }
}
